home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / mac / PageMaker 6.5 SDK Mac / SourceCode / Includes / CIInterfaceManager.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-18  |  2.1 KB  |  56 lines  |  [TEXT/CWIE]

  1. /**[f******************************************************************
  2.  *
  3.  *              IntfMgr.h -- Interface Manager
  4.  *
  5.  *              Copyright 1996(c) Adobe Systems, Inc.
  6.  *
  7.  *
  8.  *              Interface manager. It will handle Acquire and Release of
  9.  *              PageMaker interfaces. 
  10.  * $Revision:   1.1  $
  11.  *
  12.  *
  13.  *
  14.  **f]******************************************************************/
  15.  
  16. #ifndef __INTFMGR_H
  17. #define __INTFMGR_H
  18. #include "PMTypes.h"
  19.  
  20. typedef void *(CIInterfaceFactory)(char *);
  21.  
  22. class CIInterfaceManager 
  23. {
  24. public:
  25.     // Plugin can acquire pre-defined interface from PageMaker. PageMaker pre-defined
  26.     // interface are id based. The following methods should be used by plugin to
  27.     // acquire and release pre-defined PageMaker interfaces. SHOULD ONLY BE CALLED
  28.     // TO ACQUIRE AND RELEASE PRE-DEFINED PAGEMAKER INTERFACES.
  29.     virtual PMErr  AcquirePMInterface(unsigned long id, void **ppInterface) = 0;
  30.     virtual PMErr    ReleasePMInterface(void *pInterface) = 0;
  31.  
  32.     // Plugin can acquire interfaces that are published by plugins. If you acquire an
  33.     // interface by name. You should also free the interface by name. Plugin that owns
  34.     // the interface will receive a kPMAcquireInterface message to provide the
  35.     // interface when the following AcquirePMInterface method is called. Plugin that
  36.     // owns the interface will receive a kPMReleaseInterface message when the following
  37.     // ReleasePMInterface method is called.
  38.     virtual PMErr    AcquirePMInterface(char *pInterfaceName, void **ppInterface) = 0;
  39.     virtual PMErr    ReleasePMInterface(char *pInterfaceName, void **ppInterface) = 0;
  40.  
  41.     // Plugin can add and remove interface name to PageMaker. The published interface
  42.     // can be acquired through the AcquirePMInterface (by name). Plugin must call 
  43.     // RemovePMInterface to remove an interface name from PageMaker. Only plugin that
  44.     // owns the interface can remove the interface from PageMaker.
  45.     virtual PMErr    AddPMInterface(char *pInterfaceName)=0;
  46.     virtual PMErr        RemovePMInterface(char *pInterfaceName) = 0;
  47. };
  48.  
  49. typedef struct _PMInterface {
  50.     char *pInterfaceName;
  51.     void *pInterface;
  52. } PMInterface, *LPPMInterface;
  53.  
  54. #endif
  55.  
  56.